home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MACSHELL / MS1 / SAMPLES / MISCCMDS.C < prev    next >
Text File  |  1992-12-02  |  16KB  |  677 lines

  1. /*
  2.  *    MacShell Source File
  3.  *
  4.  *    Copyright (c) 1989, 1990, 1991, 1992  Suick Bay Technologies.  All rights reserved.
  5.  *
  6.  *
  7.  *    RESTRICTIONS ON MacShell program and source code.
  8.  *
  9.  *    Ñ╩MacShell¬ is a product of Suick Bay Technologies and is provided for
  10.  *    restricted use by the owner of the CDROM "Disk to the future II".
  11.  *
  12.  *    Ñ╩No permission is granted for any commercial use without the written
  13.  *    consent of the Suick Bay Technologies.
  14.  *
  15.  *    Ñ╩No permission is granted for any redistribution of any kind use without
  16.  *    the written consent of the Suick Bay Technologies.
  17.  *
  18.  *    Ñ╩Permission is granted to use this for any personal noncommercial use.
  19.  *
  20.  *    Ñ╩You may not distribute source or executable code at all, nor may you 
  21.  *    distribute it with or within a commercial product without the written
  22.  *    consent of the Suick Bay Technologies.  Please send modifications to 
  23.  *    the author for inclusion in updates to the program.  Thanks.
  24.  *
  25.  *
  26.  *    MacShell¬ IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  27.  *    WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  28.  *    PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  29.  *
  30.  *    SUICK BAY TECHNOLOGIES SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  31.  *    INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY MACSHELL
  32.  *    OR ANY PART THEREOF. 
  33.  *
  34.  *    In no event will Suick Bay Technologies be liable for any lost revenue
  35.  *    or profits or other special, indirect and consequential damages, even if
  36.  *    Suick Bay Technologies has been advised of the possibility of such damages.
  37.  *
  38.  *    Suick Bay Technologies can be reached at:
  39.  *    
  40.  *    8768 Cottonwood lane
  41.  *    Maple Grove, MN 55369
  42.  *    Voice: (612) 425-7025
  43.  *    AppleLink: D5233
  44.  *    
  45.  *
  46.  *    No parts of this software may be reproduced or stored in a
  47.  *    retrieval system or transmitted in any form, or any means,
  48.  *    electronic, mechanical, photocopying, recording or otherwise,
  49.  *    without the prior written permission of Suick Bay Technologies.
  50.  *    
  51.  *    Spread the word and not the disk.
  52.  *    
  53.  *    SPK 012290    :    Initial
  54.  */
  55.  
  56. #include    <SoundMgr.h>
  57.  
  58. #include    "SystemPub.h"
  59. #include    "Proc.h"
  60. #include    "ShellPub.h"
  61. #include    "Path.h"
  62.  
  63. /*******************************************************************/
  64.  
  65. Boolean        DoECHO( int16 ProcToken, WHandle ShellWh, int16 ProcID, 
  66.                     char *string )
  67. {
  68. ShellWindRec    **MyShell;
  69.     
  70.     MyShell = (ShellWindRec **) (**ShellWh).thing;
  71.  
  72.     switch( ProcToken )
  73.         {
  74.         case    PROC_INIT    :
  75.             (**MyShell).Proc[ ProcID ].flags = TRUE;
  76.             break;
  77.  
  78.         case    PROC_TERM    :
  79.         case    PROC_BREAK    :
  80.             /* Tell the shell that we're done */
  81.             SendOutToken( ShellWh, ProcID, PROC_BREAK );
  82.             /* Turn ourself off */
  83.             (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  84.             break;
  85.             
  86.         case    PROC_STDIN    :
  87.             if( (**MyShell).Proc[ ProcID ].flags )
  88.                 {
  89.                 int16        i, argc, newline = TRUE;
  90.                 char    *cp, argument[ 256 ];
  91.                 
  92.                 (**MyShell).Proc[ ProcID ].flags = TRUE;
  93.                  
  94.                 argc = (**MyShell).Proc[ ProcID ].argc;
  95.                 
  96.                 for( i = 1; i < argc; i++ )
  97.                     {
  98.                     GetArgv( ShellWh, ProcID, i, argument );
  99.                     cp = argument;
  100.         
  101.                     if( *cp++ == '-' )
  102.                         while( *cp )
  103.                             switch( *cp++ )
  104.                                 {
  105.                                 case    'n'    :
  106.                                     newline = FALSE;
  107.                                     break;
  108.                                 }
  109.                     }
  110.                     
  111.                 for( i = 1; i < argc; i++ )
  112.                     {
  113.                     GetArgv( ShellWh, ProcID, i, argument );
  114.                     cp = argument;
  115.         
  116.                     if( *cp++ != '-' )
  117.                         {
  118.                         cp = argument;
  119.                         while( *cp ) cp++;
  120.                         *cp++ = ' ';        /* add a space */
  121.                         *cp++ = '\0';
  122.                          StdOut( ShellWh, ProcID, argument );
  123.                          }
  124.                     }
  125.                 if( newline )
  126.                      StdOut( ShellWh, ProcID, "\n" );
  127.  
  128.                 /* Tell the shell that we're done */
  129.                 SendOutToken(  ShellWh, ProcID, PROC_BREAK );
  130.                 
  131.                 /* Turn ourself off */
  132.                 (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  133.                 return( FALSE );
  134.                 }
  135.         }
  136. }
  137.  
  138.  
  139. /*******************************************************************/
  140.  
  141. Boolean        DoSOUND( int16 ProcToken, WHandle ShellWh, int16 ProcID,
  142.                 char *string )
  143. {
  144. int16            i, argc, s=-1, doBeep = TRUE;
  145. char            *cp, argument[ 256 ];
  146. ShellWindRec    **MyShell;
  147.     
  148.     MyShell = (ShellWindRec **) (**ShellWh).thing;
  149.  
  150.     switch( ProcToken )
  151.         {
  152.         case    PROC_INIT    :
  153.             (**MyShell).Proc[ ProcID ].flags = TRUE;
  154.             break;
  155.         
  156.         case    PROC_TERM    :
  157.         case    PROC_BREAK    :
  158.             SendOutToken( ShellWh, ProcID, PROC_BREAK );
  159.             /* Turn ourself off */
  160.             (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  161.             break;
  162.             
  163.         case    PROC_STDIN    :
  164.             if( (**MyShell).Proc[ ProcID ].flags )
  165.                 {
  166.                 (**MyShell).Proc[ ProcID ].flags = FALSE;
  167.  
  168.                 /* get arguments */
  169.                 argc = (**MyShell).Proc[ ProcID ].argc;
  170.                 for( i = 1; i < argc; i++ )
  171.                     {
  172.                     GetArgv( ShellWh, ProcID, i, argument );
  173.                     cp = argument;
  174.         
  175.                     if( *cp++ == '-' )
  176.                         while( *cp )
  177.                             switch( *cp++ )
  178.                                 {
  179.                                 case    's'    :    /* silent operation */
  180.                                     doBeep = FALSE;
  181.                                     break;
  182.                                 }
  183.                     }
  184.  
  185.                 for( i = 1; i < argc; i++ )
  186.                     {
  187.                     GetArgv( ShellWh, ProcID, i, argument );
  188.                     if( *argument != '-' )
  189.                         {
  190.                         GetArgv( ShellWh, ProcID, 1, argument );
  191.                         CtoPstr( argument );
  192.                         if( GoodNum( argument ) )
  193.                             {
  194.                             PtoCstr( argument );
  195.                             s = *argument - '0';
  196.                                 
  197.                             if( s > 7 )
  198.                                 s = 7;
  199.                             if( s < 0 )
  200.                                 s = 0;
  201.                                 
  202.                             SetSoundVol(s);
  203.                             
  204.                             if( doBeep )
  205.                                 SysBeep( 1 );
  206.                             }
  207.                         }
  208.                     }
  209.  
  210.                 /* Tell the shell that we're done */
  211.                 SendOutToken(  ShellWh, ProcID, PROC_BREAK );
  212.                 
  213.                 /* Turn ourself off */
  214.                 (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  215.                 return( TRUE );
  216.                 }
  217.         }
  218. }
  219.  
  220. /*******************************************************************/
  221.  
  222. DateTimeRec        myTime;
  223.  
  224. GetShellDate( char *buf )
  225. {
  226.     GetTime( &myTime );
  227.     
  228.     sprintf( buf, "%02.0d/%02.0d/%4.0d" ,myTime.month,
  229.         myTime.day,myTime.year);
  230. }
  231.  
  232. GetShellTime( char *buf )
  233. {
  234.     GetTime( &myTime );
  235.     sprintf( buf, "%02.0d:%02.0d:%02.0d",myTime.hour,
  236.         myTime.minute,myTime.second );
  237. }
  238.  
  239. /*******************************************************************/
  240.  
  241. Boolean        DoDATE( int16 ProcToken, WHandle ShellWh, int16 ProcID, char *string )
  242. {
  243. ShellWindRec    **MyShell;
  244. char            buf[ 32 ];    
  245.  
  246.     MyShell = (ShellWindRec **) (**ShellWh).thing;
  247.  
  248.     switch( ProcToken )
  249.         {
  250.         case    PROC_INIT    :
  251.             (**MyShell).Proc[ ProcID ].flags = TRUE;
  252.             break;
  253.             
  254.         case    PROC_TERM    :
  255.         case    PROC_BREAK    :
  256.             SendOutToken( ShellWh, ProcID, PROC_BREAK );
  257.             /* Turn ourself off */
  258.             (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  259.             break;
  260.             
  261.         case    PROC_STDIN    :
  262.             if( (**MyShell).Proc[ ProcID ].flags )
  263.                 {
  264.                 (**MyShell).Proc[ ProcID ].flags = FALSE;
  265.                 
  266.                 GetShellDate( buf );
  267.                 procPrintf( ShellWh, ProcID, "Date %s\n", buf );
  268.                 
  269.                 GetShellTime( buf );
  270.                 procPrintf( ShellWh, ProcID, "Time %s\n", buf );
  271.  
  272.                 /* Tell the shell that we're done */
  273.                 SendOutToken(  ShellWh, ProcID, PROC_BREAK );
  274.                 
  275.                 /* Turn ourself off */
  276.                 (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  277.                 return( FALSE );
  278.                 }
  279.         }
  280. }
  281.  
  282. /*******************************************************************/
  283.  
  284. static int16 days_per_month[12]=
  285.         {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,};
  286.  
  287. static char *mname[]=
  288.     {
  289.     "illegal month",
  290.     "January",
  291.     "Feburary",
  292.     "March",
  293.     "April",
  294.     "May",
  295.     "June",
  296.     "July",
  297.     "August",
  298.     "September",
  299.     "October",
  300.     "November",
  301.     "December"
  302.     };
  303.  
  304. static     int16 doy[]={ 999,0,31,59,90,120,151,181,212,243,273,304,334 };
  305.  
  306. char     *monthn( int16 n )
  307. {
  308.     return((n<1 || n>12) ? mname[0]: mname[n]);
  309. }
  310.  
  311. int16  day( int16 month, int16 year )
  312. {
  313. int16     leapdtd;
  314. int16     dayown;
  315.     
  316.     if ( year < 4 )
  317.         leapdtd=0;
  318.         
  319.     else if (( month == 2 ) || ( month == 1 ))
  320.         leapdtd = ( year - 1 ) / 4;
  321.         
  322.     else leapdtd = year / 4;
  323.     
  324.     dayown = ( year + doy[ month ] - 1 + leapdtd ) %7;
  325.     
  326.     return( dayown );
  327. }
  328.  
  329. /*******************************************************************/
  330.  
  331. DumpCal( WHandle ShellWh, int16 ProcID, int16 month, int16 year )
  332. {
  333. int16     i, r;
  334. int16     temp,tempmonth,tempLY=0;
  335.  
  336.      if( (month>12) || (month <1) || (year>9999) || (year <1))
  337.          return;
  338.      
  339.      if( year < 100 )
  340.          year += 1900;
  341.          
  342.     procPrintf( ShellWh, ProcID, "\n%10s",  monthn( month ) );
  343.     
  344.     procPrintf( ShellWh, ProcID, " %d\n", year );
  345.     temp = day( month,year );
  346.     
  347.     procPrintf( ShellWh, ProcID, "--------------------\n");
  348.     procPrintf( ShellWh, ProcID, "Su Mo Tu We Th Fr Sa\n");
  349.     
  350.     for (i=1; i<=temp; i++)
  351.         procPrintf( ShellWh, ProcID, "   ");
  352.         
  353.     for (i=1; i<=(7-temp); i++)
  354.         procPrintf( ShellWh, ProcID, "%2d ",i);
  355.         
  356.     procPrintf( ShellWh, ProcID, "\n");
  357.     
  358.     if ((( year % 4 == 0 && year % 100 != 0) || year %400 ==0 ) && month == 2)
  359.         tempLY=1;
  360.         
  361.     tempmonth = (days_per_month[ month-1 ]) + tempLY;
  362.     
  363.     for( r = i; r <= tempmonth; r++ )
  364.         {
  365.         if ( ((temp+r)%7) )
  366.             procPrintf( ShellWh, ProcID, "%2d ",r);
  367.         else 
  368.             procPrintf( ShellWh, ProcID, "%2d\n",r);
  369.         }
  370.         
  371.     procPrintf( ShellWh, ProcID, "\n\n" );
  372. }
  373.  
  374. /*******************************************************************/
  375.  
  376. Boolean        DoCAL( int16 ProcToken, WHandle ShellWh, int16 ProcID, char *string )
  377. {
  378. int16        i, argc;
  379. char        *cp, argument[ 256 ];
  380. int32        t;
  381. int16        month, year;
  382.  
  383. ShellWindRec    **MyShell = (ShellWindRec **) (**ShellWh).thing;
  384.  
  385.     switch( ProcToken )
  386.         {
  387.         case    PROC_INIT    :
  388.             (**MyShell).Proc[ ProcID ].flags = TRUE;
  389.             break;
  390.             
  391.         case    PROC_TERM    :
  392.         case    PROC_BREAK    :
  393.             SendOutToken( ShellWh, ProcID, PROC_BREAK );
  394.             /* Turn ourself off */
  395.             (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  396.             break;
  397.             
  398.         case    PROC_STDIN    :
  399.             if( (**MyShell).Proc[ ProcID ].flags )
  400.                 {
  401.                 (**MyShell).Proc[ ProcID ].flags = FALSE;
  402.                 
  403.                 argc = (**MyShell).Proc[ ProcID ].argc;
  404.  
  405.                 switch( argc )
  406.                     {
  407.                     case    1    :    /* cal for this month */
  408.                         GetTime( &myTime );
  409.                         DumpCal( ShellWh, ProcID, myTime.month, myTime.year );
  410.                         break;
  411.                     
  412.                     case    2    :    /* cal for given year */
  413.                         GetArgv( ShellWh, ProcID, 1, argument );
  414.                         CtoPstr( argument );
  415.                         if( GoodNum( argument ) )
  416.                             {
  417.                             StringToNum( argument, &t );
  418.                             
  419.                             for( i = 1; i < 13; i++ )
  420.                                 {
  421.                                 if( UserAbort() )
  422.                                     break;
  423.                                 DumpCal( ShellWh, ProcID, i, (int16) t );
  424.                                 }
  425.                             }
  426.                         break;
  427.                     
  428.                     case    3    :    /* cal for given month/year */
  429.                         GetArgv( ShellWh, ProcID, 1, argument );
  430.                         CtoPstr( argument );
  431.                         if( GoodNum( argument ) )
  432.                             {
  433.                             StringToNum( argument, &t );
  434.                             month = (int16) t;
  435.                             
  436.                             GetArgv( ShellWh, ProcID, 2, argument );
  437.                             CtoPstr( argument );
  438.                             if( GoodNum( argument ) )
  439.                                 {
  440.                                 StringToNum( argument, &t );
  441.                                 year = (int16) t;
  442.                                 DumpCal( ShellWh, ProcID, month, year );
  443.                                 }
  444.                             }
  445.                         break;
  446.                     }
  447.  
  448.                 /* Tell the shell that we're done */
  449.                 SendOutToken(  ShellWh, ProcID, PROC_BREAK );
  450.                 
  451.                 /* Turn ourself off */
  452.                 (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  453.                 return( FALSE );
  454.                 }
  455.         }
  456. }
  457.  
  458. /*******************************************************************
  459.  *
  460.  *    Function PLAY
  461.  *
  462.  *    PathName Callback function
  463.  *
  464.  *    usage PLAY [options] [files]    
  465.  *
  466.  *
  467.  *******************************************************************/
  468.  
  469. extern        int16    appResFile;
  470.  
  471. #define        doPlayID        (**MyShell).Proc[ProcID].bflags.f0
  472. #define        listIDs            (**MyShell).Proc[ProcID].bflags.f1
  473. #define        playAbort        (**MyShell).Proc[ProcID].bflags.f2
  474. #define        playID            (**MyShell).Proc[ProcID].options
  475.  
  476.  
  477. void        PLAYCallBack( WHandle ShellWh, int16 ProcID, char *path, char *last,
  478.                         pathType what, int16 vRefNum, int32 dirID )
  479. {
  480. Handle            sndHandle;    
  481. SndChannelPtr    myChan = 0L;
  482. int16            fileRefNum, num, index, id, playHead = TRUE,
  483.                 resFileWasOpen = FALSE;
  484. int32            type;
  485. OSErr            err;
  486. char            str[ 64 ];
  487. ShellWindRec    **MyShell = (ShellWindRec **) (**ShellWh).thing;
  488.  
  489.     if( UserAbort() )
  490.         playAbort = TRUE;
  491.  
  492.     if( playAbort )
  493.         return;
  494.  
  495.     if( what == pathIsFile )
  496.         {
  497.         strcpy( str, last );
  498.         CtoPstr( str );
  499.  
  500.         SetWD( vRefNum, dirID );
  501.         SetResLoad( FALSE );
  502.  
  503.         if( ResFileOpen( last, vRefNum, dirID, &fileRefNum ) )
  504.             resFileWasOpen = TRUE;
  505.         else
  506.             fileRefNum = OpenResFile( str );
  507.         
  508.         if( fileRefNum == (-1) )
  509.             return;
  510.             
  511.         UseResFile( fileRefNum );
  512.  
  513.         if( doPlayID )
  514.             {
  515.             sndHandle = Get1Resource( 'snd ', (int16) playID );
  516.             if( sndHandle )
  517.                 {
  518.                 if( listIDs )
  519.                     {
  520.                     if( playHead )
  521.                         {
  522.                         sprintf( str, "%s:%s", path, last );
  523.                         MacToPath( str );
  524.                         procPrintf( ShellWh, ProcID, "play : %s\n", str );
  525.                         playHead = FALSE;
  526.                         }
  527.                     
  528.                     GetResInfo( sndHandle, &id, &type, str );
  529.                     procPrintf( ShellWh, ProcID, "     : ID %5d NAME %ps\n", id, str );
  530.                     }
  531.                 
  532.                 LoadResource( sndHandle );
  533.                 SndPlay( myChan, sndHandle, FALSE );
  534.                 ReleaseResource( sndHandle );
  535.                 }
  536.             if( err = ResError() )
  537.                 procPrintf( ShellWh, ProcID, "play : resource error %d\n", err );
  538.             }
  539.         else
  540.             {
  541.             num = Count1Resources( 'snd ' );
  542.             
  543.             for( index = 1; index <= num; index++ )
  544.                 {
  545.                 CheckFreeMem();
  546.                 sndHandle = Get1IndResource( 'snd ', index );
  547.                 if( sndHandle )
  548.                     {
  549.                     if( listIDs )
  550.                         {
  551.                         if( playHead )
  552.                             {
  553.                             sprintf( str, "%s:%s", path, last );
  554.                             MacToPath( str );
  555.                             procPrintf( ShellWh, ProcID, "play : %s\n", str );
  556.                             playHead = FALSE;
  557.                             }
  558.                         
  559.                         GetResInfo( sndHandle, &id, &type, str );
  560.                         procPrintf( ShellWh, ProcID, "     : ID %5d NAME %ps\n", id, str );
  561.                         }
  562.                         
  563.                     LoadResource( sndHandle );
  564.                     SndPlay( myChan, sndHandle, FALSE );
  565.                     ReleaseResource( sndHandle );
  566.                     }
  567.                 if( err = ResError() )
  568.                     {
  569.                     procPrintf( ShellWh, ProcID, "play : resource error %d\n", err );
  570.                     break;
  571.                     }
  572.                 }
  573.             }
  574.             
  575.         if( !resFileWasOpen )
  576.             CloseResFile( fileRefNum );
  577.             
  578.         SetResLoad( TRUE );
  579.         UseResFile( appResFile );
  580.         }
  581. }
  582.  
  583. /*******************************************************************/
  584.  
  585. void        PLAYFile( WHandle ShellWh, int16 ProcID, char *argument )
  586. {
  587. ShellWindRec    **MyShell;
  588.  
  589.     MyShell = (ShellWindRec **) (**ShellWh).thing;
  590.  
  591.     ExpandPath( ShellWh, ProcID, argument, (ProcPtr) PLAYCallBack,
  592.             (**MyShell).pwdVRefNum, (**MyShell).pwdDirID );
  593.  
  594.     ResetShellPWD( ShellWh );
  595. }
  596.  
  597. /*******************************************************************/
  598.  
  599. Boolean            DoPLAY( int16 ProcToken, WHandle ShellWh, int16 ProcID, char *string )
  600. {
  601. int16            i, argc, hasNoFile = TRUE;
  602. char            *cp, argument[ 256 ];
  603. ShellWindRec    **MyShell = (ShellWindRec **) (**ShellWh).thing;
  604.  
  605.     switch( ProcToken )
  606.         {
  607.         case    PROC_INIT    :
  608.             (**MyShell).Proc[ ProcID ].flags = TRUE;
  609.             break;
  610.             
  611.         case    PROC_TERM    :
  612.         case    PROC_BREAK    :
  613.             playAbort = TRUE;
  614.             /* Tell the shell that we're done */
  615.             SendOutToken( ShellWh, ProcID, PROC_BREAK );
  616.             /* Turn ourself off */
  617.             (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  618.             break;
  619.             
  620.         case    PROC_STDIN    :
  621.             if( (**MyShell).Proc[ ProcID ].flags )
  622.                 {
  623.                 (**MyShell).Proc[ ProcID ].flags = FALSE;        
  624.  
  625.                 /* get arguments */
  626.                 argc = (**MyShell).Proc[ ProcID ].argc;
  627.                 doPlayID = FALSE;
  628.                 listIDs = FALSE;
  629.                 playAbort = FALSE;
  630.                 
  631.                 for( i = 1; i < argc; i++ )
  632.                     {
  633.                     GetArgv( ShellWh, ProcID, i, argument );
  634.                     cp = argument;
  635.         
  636.                     if( *cp++ == '-' )
  637.                         while( *cp )
  638.                             switch( *cp++ )
  639.                                 {
  640.                                 case    'i'    :    /* next is ID */
  641.                                     GetArgv( ShellWh, ProcID, i+1, argument );
  642.                                     CtoPstr( argument );
  643.                                     StringToNum( argument, &playID );
  644.                                     doPlayID = TRUE;
  645.                                     break;
  646.                                     
  647.                                 case    'v'    :    /* list snd ids */
  648.                                     listIDs = TRUE;
  649.                                     break;
  650.                                 }
  651.                     }
  652.  
  653.                 for( i = 1; i < argc; i++ )
  654.                     {
  655.                     GetArgv( ShellWh, ProcID, i, argument );
  656.                     if( (*argument == '-') && (argument[1] == 'i') )
  657.                         i++;
  658.                     else if( *argument != '-' )
  659.                         {
  660.                         hasNoFile = FALSE;
  661.                         PLAYFile( ShellWh, ProcID, argument );
  662.                         }
  663.                     }
  664.                 
  665.                 if( hasNoFile )
  666.                     SysBeep( 1 );
  667.  
  668.                 /* Tell the shell that we're done */
  669.                 SendOutToken(  ShellWh, ProcID, PROC_BREAK );
  670.                 
  671.                 /* Turn ourself off */
  672.                 (**MyShell).Proc[ ProcID ].ProcActive = FALSE;
  673.                 return( FALSE );
  674.                 }
  675.         }
  676. }
  677.